Skip to content

Conversation

john-wagster
Copy link
Contributor

Community member found an error in the docs related to the update api and the default for _source:
https://elasticstack.slack.com/archives/C018C7B9T5F/p1734000667617069

Quickly validated with this query:

curl -XPOST --header 'Content-Type: application/json' "http://localhost:9200/test/_update/1?_source=true" -d '{
  "doc": {
    "text": "new_name3"
  },
  "doc_as_upsert": true
}'

with _source=true or _source=text in the query params I get:

{
    "_index": "test",
    "_id": "1",
    "_version": 2,
    "result": "noop",
    "_shards": {
        "total": 0,
        "successful": 0,
        "failed": 0
    },
    "_seq_no": 1,
    "_primary_term": 1,
    "get": {
        "_seq_no": 1,
        "_primary_term": 1,
        "found": true,
        "_source": {
            "text": "new_name3"
        }
    }
}

without _source in the query params I get:

{
    "_index": "test",
    "_id": "1",
    "_version": 2,
    "result": "noop",
    "_shards": {
        "total": 0,
        "successful": 0,
        "failed": 0
    },
    "_seq_no": 1,
    "_primary_term": 1
}

This is the correct behavior we want. So I just inverted the language in the docs.

@john-wagster john-wagster added >docs General docs changes auto-backport Automatically create backport pull requests when merged :Search Relevance/Search Catch all for Search Relevance v9.0.0 v8.17.1 v8.18.0 v7.17.27 labels Dec 12, 2024
Copy link
Contributor

Documentation preview:

@elasticsearchmachine elasticsearchmachine added Team:Docs Meta label for docs team Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch labels Dec 12, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.17
8.x
7.17

john-wagster added a commit to john-wagster/elasticsearch that referenced this pull request Dec 12, 2024
maxhniebergall pushed a commit to maxhniebergall/elasticsearch that referenced this pull request Dec 16, 2024
maxhniebergall pushed a commit to maxhniebergall/elasticsearch that referenced this pull request Dec 16, 2024
sarog pushed a commit to portsbuild/elasticsearch that referenced this pull request Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >docs General docs changes :Search Relevance/Search Catch all for Search Relevance Team:Docs Meta label for docs team Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v7.17.27 v8.17.1 v8.18.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants